package com.yhq.ojbackendjudgeservice.judge.sandbox.impl;

import com.yhq.ojbackendjudgeservice.client.CodeSandboxClient;
import com.yhq.ojbackendjudgeservice.judge.sandbox.CodeSandBox;
import com.yhq.ojbackendmodel.model.codesandbox.ExcuteCodeRequest;
import com.yhq.ojbackendmodel.model.codesandbox.ExcuteCodeResponse;

/**
 * @program: oj-backend
 * @description: 远程代码沙箱实现类
 * @author: HenryYang
 * @create: 2023-08-23 15:36
 **/
public class RemoteCodeSandBoxImpl implements CodeSandBox {
    private static final String AUTH_REQUEST_HEADER = "auth";
    private static final String SECRET_KEY = "secretKey";
    @Override
    public ExcuteCodeResponse excuteCode(ExcuteCodeRequest excuteCodeRequest){
        CodeSandboxClient codeSandboxClient = new CodeSandboxClient(AUTH_REQUEST_HEADER,SECRET_KEY);
        return codeSandboxClient.executeCode(excuteCodeRequest);
    }
}